function Bullet(){
    this.bullet;
    this.level = 0;
    this.looper;
    Game.bulletX ;
    Game.bulletY ;
    this.isShow = true;
    this.load();
}
Bullet.prototype.load = function(){
    this.bullet = $('<div class="bullet">');
    var bgimg = '';
    switch (this.level){
        case 0:bgimg = '';
        break;
        case 1:bgimg = '';
        break;
        case 2:bgimg = '';
        break;
        default:console.log('敬请期待...');
    }
    this.bullet.css({'left':Game.posX + 'px','top':Game.posY + 'px'});
    Game.container.append(this.bullet);
    Game.bulletX = this.bullet.offset().left;
    Game.bulletY = this.bullet.offset().top - Game.container.offset().top ;
    this.bulletFly();
    // this.hit();
}
Bullet.prototype.bulletFly = function(){
    var _top = 0;
    var self = this;
    function reduceself(){
        _top -=3;
        if(_top < Game.bulletY * -1){
            clearInterval(timer);
            self.bullet.remove();
            self.isShow = false;
        }
        if(self.isShow){
            self.bullet.css('top',Game.bulletY + _top + 'px');
        }
        self.hit();
    }
    var timer = setInterval(reduceself,16.7);
}
Bullet.prototype.hit = function(){
    var self = this;
    Game.enemyArr.map(function(ele){
        if(self.bullet.offset().left >= ele.enemy.offset().left&&self.bullet.offset().left <= ele.enemy.offset().left + ele.enemy.width()&&
        self.bullet.offset().top <= ele.enemy.offset().top){
            ele.hitCounts ++;
            if(ele.hitCounts >= 3){
                self.bullet.remove();
                ele.destroyed();
            }
            
        }
    
    })
}